package com.wimcorp.magic.abilities.trigger;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToOne;

import com.wimcorp.magic.abilities.Ability;
import com.wimcorp.magic.abilities.Suspend;
@Entity
public class OnSuspendTimeCounterReduced extends AbilityTrigger{

	@OneToOne(fetch = FetchType.EAGER)
	private Suspend suspendAbility;
	
	public OnSuspendTimeCounterReduced(){}
	
	public OnSuspendTimeCounterReduced(Ability ability,Suspend suspendAbility){
		super(ability);
		this.suspendAbility = suspendAbility;
	}

	public OnSuspendTimeCounterReduced(OnSuspendTimeCounterReduced abilityTrigger) {
		super(abilityTrigger);
	}
	
	@Override
	public void register() {
		suspendAbility.registerTimeCounterReducedObserver(getAbility());
	}
	
	public void unRegister() {
		suspendAbility.unRegisterTimeCounterReducedObserver(getAbility());
	}
	
	public OnSuspendTimeCounterReduced clone() {
		return new OnSuspendTimeCounterReduced(this);
	}

	public Suspend getSuspendAbility() {
		return suspendAbility;
	}

	public void setSuspendAbility(Suspend suspendAbility) {
		this.suspendAbility = suspendAbility;
	}
	
	
	
}
